package com.xbongbong.admin.domain.entity;

import com.xbongbong.paas.domain.entity.PaasFormEntity;
import com.xbongbong.paas.toolbox.wrap.Entity;
import com.xbongbong.saas.domain.entity.WorkOrderFormEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author guohui.zhang
 * @Title: 表单副本表(镜像3.0回退)
 * @date 2020/3/179:33
 */
@Getter
@Setter
@ToString
public class PaasFormRetainEnity extends Entity {

    private static final long serialVersionUID = 5947954036258470964L;

    //========== properties ==========

    /**
     * 主键
     */
    private Long id;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 备份应用id
     */
    private Long retainAppId;
    /**
     * 原应用id
     */
    private Long sourceAppId;
    /**
     * 原菜单id
     */
    private Long sourceMenuId;
    /**
     * 原表单id
     */
    private Long sourceFormId;
    /**
     * 表单名称
     */
    private String name;
    /**
     * saas标记
     */
    private Integer saasMark;
    /**
     * 业务类型
     */
    private Integer businessType;
    /**
     * 启用
     */
    private Integer enable;
    /**
     * 是否流程表单，1是，0否
     */
    private Integer isProcessForm;
    /**
     * 表单验证规则
     */
    private String verifyRule;
    /**
     * 不可见字段赋值，1 保持原值，2 空值，3 始终重新计算
     */
    private Integer disableFieldAssign;
    /**
     * 前端缓存，1 启用，0 禁用
     */
    private Integer frontCache;
    /**
     * 数据标题类型，1第一个字段，2自定义标题
     */
    private Integer titleType;
    /**
     * 自定义标题，具体指定格式
     */
    private String customTitle;

    /**
     * 关联列表设置
     */
    private String associationList;
    /**
     *  业务规则
     */
    private String businessRules;
    /**
     * 费用
     */
    private String surcharge;
    /**
     * 是否开启业绩分配
     */
    private Integer openDistribution;
    /**
     * 销售价格关联，用于出库单；1：开启；0：不开启
     */
    private Integer priceAssociation;
    /**
     * 自定义摘要，具体指定格式, 用于手机端列表页显示
     */
    private String summary;
    /**
     * 标签列表，最多5个字段
     */
    private String labels;
    /**
     * 协同人权限设置
     */
    private String coOpPerms;
    /**
     * 使用权限设置
     */
    private String permission;
    /**
     * 创建者id
     */
    private String creatorId;
    /**
     * 创建时间时间戳
     */
    private Long addTime;
    /**
     * 更新时间时间戳
     */
    private Long updateTime;
    /**
     * 删除标记
     */
    private Integer del;

    /**
     * 钉钉待办模板code
     */
    private String dingtalkProcessCode;

    /**
     * 表单的单位列宽
     */
    private String fieldPosition;

    private Integer distributorMark;

    private Integer hidden;


    public PaasFormRetainEnity() {
    }

    public PaasFormRetainEnity(PaasFormEntity paasFormEntity) {
        this.corpid = paasFormEntity.getCorpid();
        this.sourceAppId = paasFormEntity.getAppId();
        this.sourceMenuId = paasFormEntity.getMenuId();
        this.sourceFormId = paasFormEntity.getId();
        this.name = paasFormEntity.getName();
        this.saasMark = paasFormEntity.getSaasMark();
        this.businessType = paasFormEntity.getBusinessType();
        this.enable = paasFormEntity.getEnable();
        this.isProcessForm = paasFormEntity.getIsProcessForm();
        this.verifyRule = paasFormEntity.getVerifyRule();
        this.disableFieldAssign = paasFormEntity.getDisableFieldAssign();
        this.frontCache = paasFormEntity.getFrontCache();
        this.titleType = paasFormEntity.getTitleType();
        this.customTitle = paasFormEntity.getCustomTitle();
        this.associationList = paasFormEntity.getAssociationList();
        this.businessRules = paasFormEntity.getBusinessRules();
        this.surcharge = paasFormEntity.getSurcharge();
        this.openDistribution = paasFormEntity.getOpenDistribution();
        this.priceAssociation = paasFormEntity.getPriceAssociation();
        this.summary = paasFormEntity.getSummary();
        this.labels = paasFormEntity.getLabels();
        this.coOpPerms = paasFormEntity.getCoOpPerms();
        this.permission = paasFormEntity.getPermission();
        this.creatorId = paasFormEntity.getCreatorId();
        this.addTime = paasFormEntity.getAddTime();
        this.updateTime = paasFormEntity.getUpdateTime();
        this.del = paasFormEntity.getDel();
        this.dingtalkProcessCode = paasFormEntity.getDingtalkProcessCode();
        this.fieldPosition = paasFormEntity.getFieldPosition();
        this.hidden = paasFormEntity.getHidden();
        this.distributorMark = paasFormEntity.getDistributorMark();
    }

    public PaasFormRetainEnity(WorkOrderFormEntity workOrderFormEntity) {
        this.corpid = workOrderFormEntity.getCorpid();
        this.sourceAppId = workOrderFormEntity.getAppId();
        this.sourceMenuId = workOrderFormEntity.getMenuId();
        this.sourceFormId = workOrderFormEntity.getId();
        this.name = workOrderFormEntity.getName();
        this.enable = workOrderFormEntity.getEnable();
        this.isProcessForm = workOrderFormEntity.getIsProcessForm();
        this.verifyRule = workOrderFormEntity.getVerifyRule();
        this.disableFieldAssign = workOrderFormEntity.getDisableFieldAssign();
        this.frontCache = workOrderFormEntity.getFrontCache();
        this.titleType = workOrderFormEntity.getTitleType();
        this.customTitle = workOrderFormEntity.getCustomTitle();
        this.associationList = workOrderFormEntity.getAssociationList();
        this.businessRules =workOrderFormEntity.getBusinessRules();
        this.summary = workOrderFormEntity.getSummary();
        this.labels = workOrderFormEntity.getLabels();
        this.coOpPerms = workOrderFormEntity.getCoOpPerms();
        this.creatorId = workOrderFormEntity.getCreatorId();
        this.addTime = workOrderFormEntity.getAddTime();
        this.updateTime = workOrderFormEntity.getUpdateTime();
        this.del = workOrderFormEntity.getDel();
        this.fieldPosition = workOrderFormEntity.getFieldPosition();
    }
}
